<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>@title</title>
    <link href="@g.bootstrap_css" rel="stylesheet">
    <link href="@g.toastr_css" rel="stylesheet">
    <link href="/static/trumbowyg/trumbowyg.min.css" rel="stylesheet">
    <link href="/static/trumbowyg/colors.min.css" rel="stylesheet">
    <link href="/static/trumbowyg/emoji.min.css" rel="stylesheet">
    <link href="/static/common.css?@g.start_time" rel="stylesheet">
    <link href="/static/blog.css?@g.start_time" rel="stylesheet">
    @g.statistics
</head>
<body>
@g.navbar
<div class="container col-md-8 col-md-offset-2">
<form method="post">
    <div class="form-group">
        <div><input class="form-control" name="title" value="@blog.title" autofocus required></div>
        <div>
            <textarea class="form-control editor" name="content" required>@blog.content</textarea>
        </div>
    </div>
    <div class="form-group" style="text-align:center;">
        <div class="btn-group">
            <button class="btn btn-success"> 　保　存　 </button>
            #if @modify != 0:
            <a href="/blog?id=@blog.id" class="btn btn-warning"> 　取　消　 </a>
            #end
        </div>
    </div>

</form>
</div>
@g.footer
</body>
<script src="@g.jquery_js"></script>
<script src="@g.bootstrap_js"></script>
<script src="@g.toastr_js"></script>
<script src="/static/trumbowyg/trumbowyg.min.js"></script>
<script src="/static/trumbowyg/colors.min.js"></script>
<script src="/static/trumbowyg/emoji.min.js"></script>
<script src="/static/trumbowyg/base64.min.js"></script>
<script src="/static/trumbowyg/pasteimage.min.js"></script>
<script src="/static/trumbowyg/preformatted.min.js"></script>
<script src="/static/trumbowyg/zh_cn.js"></script>
<script src="/static/common.js?@g.start_time"></script>
<script>
$(function(){
    $('.editor').trumbowyg({
        lang:'zh_cn',
        tagsToRemove: ['script'],
        autogrow: true,
        autogrowOnEnter: true,
        imageWidthModalEdit: true,
        btns: [
            ['viewHTML'],
            ['strong', 'em', 'underline', 'del'],
            ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
            ['unorderedList', 'orderedList'],
            ['formatting'],
            ['superscript', 'subscript'],
            ['foreColor', 'backColor'],
            ['link'],
            ['insertImage', 'base64', 'emoji'],
            ['horizontalRule'],
            ['removeformat'],
            ['preformatted'],
            ['fullscreen'],
        ],
    });
    setTimeout(function(){$('[autofocus]').focus();}, 1000);
});
</script>
</html>
